<div style="color:Black;background-color:White;"><pre>
<span style="color:Green;">// abstract_keyword.cs</span>
<span style="color:Green;">// Abstract Classes</span>
<span style="color:Blue;">using</span> System;
<span style="color:Blue;">abstract</span> <span style="color:Blue;">class</span> MyBaseC
{
    <span style="color:Blue;">protected</span> <span style="color:Blue;">int</span> x = 100;
    <span style="color:Blue;">protected</span> <span style="color:Blue;">int</span> y = 150;
    <span style="color:Blue;">public</span> <span style="color:Blue;">abstract</span> <span style="color:Blue;">void</span> MyMethod();   <span style="color:Green;">// Abstract method</span>

    <span style="color:Blue;">public</span> <span style="color:Blue;">abstract</span> <span style="color:Blue;">int</span> GetX   <span style="color:Green;">// Abstract property</span>
    {
        <span style="color:Blue;">get</span>;
    }

    <span style="color:Blue;">public</span> <span style="color:Blue;">abstract</span> <span style="color:Blue;">int</span> GetY   <span style="color:Green;">// Abstract property</span>
    {
        <span style="color:Blue;">get</span>;
    }
}

<span style="color:Blue;">class</span> MyDerivedC : MyBaseC
{
    <span style="color:Blue;">public</span> <span style="color:Blue;">override</span> <span style="color:Blue;">void</span> MyMethod()
    {
        x++;
        y++;
    }

    <span style="color:Blue;">public</span> <span style="color:Blue;">override</span> <span style="color:Blue;">int</span> GetX   <span style="color:Green;">// overriding property</span>
    {
        <span style="color:Blue;">get</span>
        {
            <span style="color:Blue;">return</span> x + 10;
        }
    }

    <span style="color:Blue;">public</span> <span style="color:Blue;">override</span> <span style="color:Blue;">int</span> GetY   <span style="color:Green;">// overriding property</span>
    {
        <span style="color:Blue;">get</span>
        {
            <span style="color:Blue;">return</span> y + 10;
        }
    }

    <span style="color:Blue;">public</span> <span style="color:Blue;">static</span> <span style="color:Blue;">void</span> Main()
    {
        MyDerivedC mC = <span style="color:Blue;">new</span> MyDerivedC();
        mC.MyMethod();
        Console.WriteLine(<span style="color:#A31515;">&quot;x = {0}, y = {1}&quot;</span>, mC.GetX, mC.GetY);
    }
}
</pre></div>